package com.gticket.cinemauser.service.impl;

import com.gticket.cinemauser.mapper.PermMapper;
import com.gticket.cinemauser.pojo.Perms;
import com.gticket.cinemauser.pojo.Role;
import com.gticket.cinemauser.service.PermService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class PermServiceImpl implements PermService {

    @Resource
    private PermMapper permMapper;
    /**
     * 通过角色id查询对应权限
     * @param role  role对象
     * @return List<Perms>
     */
    @Override
    public List<Perms> selectPermsByRole_id(Role role) {
        List<Perms> perms = new ArrayList<>();
        //查询响应权限
        perms = permMapper.selectPermsByRole_id(role);
        return perms;
    }
}
